/* $Id: ViewMenuUnitTest.java 63 2010-02-14 13:52:34Z aaron.day $ */
package org.crazydays.gameplan.view;


import javax.swing.JMenuItem;

import org.junit.*;
import static org.junit.Assert.*;

import org.crazydays.gameplan.map.action.ToggleGrid;

/**
 * ViewMenuUnitTest
 */
public class ViewMenuUnitTest
{
    /**
     * Test initialize().
     */
    @Test
    public void testInitialize()
    {
        // objects
        ToggleGrid toggleGrid = new ToggleGrid();

        // setup
        ViewMenu component = new ViewMenu();
        component.setToggleGrid(toggleGrid);

        // test
        component.initialize();

        // verify
        assertEquals("count", 1, component.getMenuComponentCount());
        assertTrue("toggleGrid",
            component.getMenuComponent(0) instanceof JMenuItem);
        assertEquals("toggleGrid", toggleGrid, ((JMenuItem) component
            .getMenuComponent(0)).getAction());
    }
}
